home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat2 / dreaddir.nr < prev    next >
Encoding:
Text File  |  1993-03-03  |  2.0 KB  |  67 lines

  1.  
  2.  
  3.  
  4. Dreaddir(2)                Oct. 1, 1991               Dreaddir(2)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        Dreaddir - read directory information
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        LONG Dreaddir( WORD len, LONG dirhandle, char *buf);
  12.  
  13. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  14.        _✓r_✓e_✓a_✓d_✓d_✓i_✓r  returns the next file in the directory whose han-
  15.        dle (from the _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r system  call)  is  _✓d_✓i_✓r_✓h_✓a_✓n_✓d_✓l_✓e.   The
  16.        file's  name  and (optionally) a 4 byte index for the file
  17.        are placed in the buffer pointed  to  by  _✓b_✓u_✓f.   The  file
  18.        index  is omitted if the directory was opened in "compati-
  19.        bility" mode (see _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r(2) for details); otherwise,  it
  20.        is  placed first in the buffer, followed by the (null ter-
  21.        minated) name. If two names have the same index, then they
  22.        refer  to  the  same  file;  the converse, however, is not
  23.        true.
  24.  
  25.        _✓l_✓e_✓n is the size of the buffer,  in  total;  it  should  be
  26.        large  enough  to  hold the index (if any), the file name,
  27.        and the trailing 0.
  28.  
  29.        Successive calls to _✓D_✓r_✓e_✓a_✓d_✓d_✓i_✓r will return all the names  in
  30.        the  directory,  one  after another, unless the _✓D_✓r_✓e_✓w_✓i_✓n_✓d_✓d_✓i_✓r
  31.        system call is used to restart the reading at  the  begin-
  32.        ning of the directory.
  33.  
  34. R✓RE✓ET✓TU✓UR✓RN✓NS✓S
  35.        0 if successful
  36.  
  37.        ERANGE  if  the  buffer  was  not large enough to hold the
  38.        index (if present) and name
  39.  
  40.        ENMFIL if there are no more file names to be read from the
  41.        directory
  42.  
  43. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  44.        _✓D_✓c_✓l_✓o_✓s_✓e_✓d_✓i_✓r(2), _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r(2) _✓D_✓r_✓e_✓w_✓i_✓n_✓d_✓d_✓i_✓r(2)
  45.  
  46. B✓BU✓UG✓GS✓S
  47.        Failure  to call Dclosedir() when the search is done could
  48.        result in  the  system  eventually  running  out  of  file
  49.        indices;  this  is fatal.  So always call Dclosedir() when
  50.        you're finished with the directory search!
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Version 0.9          MiNT Programmer's Manual                   1
  65.  
  66.  
  67.